/*
 * File:   testMember.cpp
 * Author: zacc
 *
 * Created on Feb 10, 2015, 3:54:06 AM
 */

#include "testMember.h"
#include "../Member.h"


CPPUNIT_TEST_SUITE_REGISTRATION(testMember);

testMember::testMember() {
}

testMember::~testMember() {
}

void testMember::setUp() {
}

void testMember::tearDown() {
}

void testMember::testConstructor() {
    string UserID = "test1";
    string UserPass = "test2";
    string Role = "test3";
    bool Perm = false;
    
    Member m(UserID,UserPass,Role,Perm);
    
    CPPUNIT_ASSERT_EQUAL(UserID, m.getUID());
    CPPUNIT_ASSERT_EQUAL(UserPass, m.getUPW());
    CPPUNIT_ASSERT_EQUAL(Role, m.getRole());
    CPPUNIT_ASSERT_EQUAL(Perm, m.getPerm());
}

void testMember::testGet()
{
    Member m("test1","test2","test3",false);
    CPPUNIT_ASSERT(m.getUID() == "test1");
    CPPUNIT_ASSERT(m.getUPW() == "test2");
    CPPUNIT_ASSERT(m.getRole() == "test3");
    CPPUNIT_ASSERT(m.getPerm() == false);
}

void testMember::testSet()
{
    Member m;
    m.setUID("test1");
    m.setUPW("test2");
    m.setRole("test3");
    m.setPerm(false);
    
    CPPUNIT_ASSERT(m.getUID() == "test1");
    CPPUNIT_ASSERT(m.getUPW() == "test2");
    CPPUNIT_ASSERT(m.getRole() == "test3");
    CPPUNIT_ASSERT(m.getPerm() == false);
}

